﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Zj.DockerSample.Domain.Core;

namespace Zj.DockerSample.Repositories.EntityFrameworkCore.Models
{
    public class UserDbContextSeed
    {
        public async System.Threading.Tasks.Task SeedAsync(UserDbContext userContext, IServiceProvider services)
        {
            var set = userContext.User;
            if (!set.Any())
            {
                var user = new User()
                {
                    Name = "admin",
                    CompanyName = "ppm",
                    Title = ".Net Developer"
                };
                await userContext.AddAsync(user);
                await userContext.SaveChangesAsync();
            }
        }
    }
}
